home *** CD-ROM | disk | FTP | other *** search
- Path: library.erc.clarkson.edu!koglerje
- From: koglerje@craft.camp.clarkson.edu (Mountain (jimbo) )
- Newsgroups: comp.lang.c
- Subject: Re: Can main() function be called?
- Date: 6 Feb 1996 04:59:19 GMT
- Organization: Clarkson University
- Message-ID: <4f6n77$e53@library.erc.clarkson.edu>
- References: <823183263.118@fountain.demon.co.uk> <4f1mv0$2fd@cloner4.netcom.com>
- NNTP-Posting-Host: craft.camp.clarkson.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Mike Rosenblyum (rozen@ix.netcom.com) wrote:
- : I think that it cannot be done, I see no reasonalbe way how main()
- : could be called more than once.
-
-
- : What is your thoughts on this?
-
-
- Sure you can call main() again, well kindof, just uses setjmp()
- and longjmp() just put a setjump() call inside main() like:
-
- int main()
- {
- setjmp(jmp_buf hi);
- ..
- }
-
- then when you want to "run main()" again, just call longjmp(jmp_buff hi, int i);
- you will have to look up the specifics but this is standard across the platforms. the real question is WHY would you want to do this??????
-
- hope i was of some assistance.
- jimbo
- koglerje@wckn.dorm
-
- --
- ----
- just another sig
-
-
-